/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package simhya.matheval;
import java.util.ArrayList;

/**
 *
 * @author Luca
 */
public class ExpressionVariableNode extends ExpressionNode {
    Expression expression;
    String name;


     public ExpressionVariableNode(String name,Expression exp) {
        super(0);
        this.expression = exp;
        this.name = name;
    }


    @Override
    public void getListOfVariables(ArrayList<Integer> list) {
        return;
    }

    @Override
    String getExpressionString(boolean fullNumberRepresentation) {
        return this.name;
    }

    @Override
    void computeValue() {
        super.value = expression.computeValue();
    }

    @Override
    void computeValue(SymbolArray varReference) {
        super.value = expression.computeValue(varReference);
    }

    @Override
    void computeValue(int evaluationCode) {
        super.value = expression.computeValueCache();
    }

    @Override
    void computeValue(SymbolArray varReference, int evaluationCode) {
        super.value = expression.computeValueCache(varReference);
    }
    
}
